<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>{$app_name}</title>
<link href="{$TemplateAdminDir}style.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery.min.js"></script>
</head>
<body style=" background:#fff">
<!--{if $mm_show eq "e_list"} -->
<div>
<h3>员工列表</h3> <hr>
<form action="" method="post" name="elist">
<table border="0" cellspacing="1" cellpadding="0" width="100%" bgcolor="#CCCCCC">
  <tr bgcolor="#33CCCC">
    <th scope="col">工编号</th>
    <th scope="col">姓名</th>
    <th scope="col">性别</th>
    <th scope="col">所属部门</th>
    <th scope="col">角色</th>
    <th scope="col">是否管理员</th>
    <th scope="col">操作</th>
  </tr>
  <!--{foreach from=$employees item=e} -->
  <tr bgcolor="#FFFFFF">
    <td align="center">{$e.id}</td>
    <td align="center">{$e.e_name}</td>
    <td align="center">{if $e.e_sex}男{else}女{/if}</td>
    <td align="center">{if $e.e_depart}{$e.e_depart}{else}<font color="red">未设置部门</font>{/if}</td>
    <td align="center">{if $e.e_group}{$e.e_group}{else}<font color="red">未设置角色</font>{/if}</td>
    <td align="center">{if $e.is_admin}<font color="green">是</font>{else}<font color="red">否</font>{/if}</td>
    <td align="center">
      <a href="employee.php?act=mod&eid={$e.id}">修改</a> &nbsp;&nbsp;
      <a href="employee.php?act=del&eid={$e.id}">删除</a></td>
  </tr>
  <!--{foreachelse} -->
  <tr bgcolor="#FFFFFF"><td colspan="8" align="center">没有数据</td></tr>
  <!--{/foreach} -->
</table>

</form>
</div>
<!--{/if} -->
<!--{if $mm_show eq "e_add"} -->
<div>
<h3>添加员工</h3> &nbsp;&nbsp;  新添加员工初始密码为：888 <hr>
<form action="" method="post" name="eadd">
<table border="0" cellspacing="5" cellpadding="0">
  <tr>
    <td>姓名：</td>
    <td><input type="text" name="name" /></td>
  </tr>
  <tr>
    <td>性别：</td>
    <td><input type="radio" name="sex" value="1" />男
      <input type="radio" name="sex" value="0" checked />女
    </td>
  </tr>  
  <tr>
    <td>所属部门：</td>
    <td>
      <select name="depart">
      <option value="0">--请选择--</option>
      <!--{foreach from=$depart item=d} -->
        <option value="{$d.id}">{$d.d_name}</option>
      <!--{/foreach} -->     
      </select>
    </td>
  </tr>
  <tr>
    <td>角色：</td>
    <td><select name="group">    
      <option value="0">--请选择--</option>
      <!--{foreach from=$group item=g} -->
        <option value="{$g.g_name}">{$g.g_name}</option>
      <!--{/foreach} -->     
      </select></td>
  </tr>
  
  <tr>
    <td colspan="2" align="right">
    <a href="#" id="moreinfo"  style="color:blue; text-decoration:none;">添加更多信息</a>
    </td>
  </tr>
  <script type="text/javascript">
$(document).ready(function(){
  $("#moreinfo").click(function(){
    $("#moreinfotable").slideToggle();
  });
});

</script>
  <tr id="moreinfotable" style="display:none;">
    <td colspan="2" align="left">
    <table border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td>是否为管理员：</td>
    <td>
    <input type="radio" name="admin" value="1" />是
      <input type="radio" name="admin" value="0" checked />否
    </td>
  </tr>
  <tr>
    <td>毕业院校：</td>
    <td><input type="text" name="college" /></td>
  </tr>
  <tr>
    <td>身份证号：</td>
    <td><input type="text" name="cardid" /></td>
  </tr>  
  <tr>
    <td>家庭住址：</td>
    <td><input type="text" name="homeaddress" /></td>
  </tr>
  <tr>
    <td>目前住址：</td>
    <td><input type="text" name="address" /></td>
  </tr>
  <tr>
    <td>电话：</td>
    <td><input type="text" name="phone" /></td>
  </tr>
  <tr>
    <td>紧急情况联系人：</td>
    <td><input type="text" name="econtact" /></td>
  </tr>
  <tr>
    <td>紧急情况联系电话：</td>
    <td><input type="text" name="ephone" /></td>
  </tr>
</table>

    </td>
  </tr>
  
  <tr>
    <td colspan="2" align="center" height="35" valign="bottom">
    <input type="hidden" name="act" value="addu" />
    <input type="submit" value="添加" /> &nbsp; &nbsp;
    <input type="reset" value="重置" />
    </td>
  </tr>
</table>

</form>
</div>
<!--{/if} -->
<!--{if $mm_show eq "e_mod"} -->
<div>
<h3>修改员工信息</h3> <hr>
<form action="" method="post" name="emod">
<script>
    $("document").ready(function(){
        $("#pass").focus(function(){
            $(this).val('');
        });
    });
  </script>
<table border="0" cellspacing="5" cellpadding="0">
  <tr>
    <td>姓名：</td>
    <td><input type="text" name="name" value="{$employee.e_name}" /></td>
  </tr>
  <tr>
    <td>密码：</td>
    <td><input type="password" name="pass" value="{$employee.e_pass}" id="pass" /></td>
  </tr>
  <tr>
    <td>性别：</td>
    <td><input type="radio" name="sex" value="1" {if $employee.e_sex} checked {/if} />男
      <input type="radio" name="sex" value="0" {if $employee.e_sex eq 0} checked {/if} />女
    </td>
  </tr>  
  <tr>
    <td>所属部门：</td>
    <td>
      <select name="depart">
      <option value="0">--请选择--</option>
      <!--{foreach from=$depart item=d} -->
        <option value="{$d.id}" {if $employee.e_depart eq $d.id} selected="selected" {/if}>{$d.d_name}</option>
      <!--{/foreach} -->     
      </select>
    </td>
  </tr>
  <tr>
    <td>角色：</td>
    <td><select name="group">    
      <option value="0">--请选择--</option>
      <!--{foreach from=$group item=g} -->
        <option value="{$g.g_name}" {if $employee.e_group eq $g.g_name} selected="selected" {/if}>{$g.g_name}</option>
      <!--{/foreach} -->     
      </select></td>
  </tr>
  
  <tr>
    <td colspan="2" align="right">
    <a href="#" id="moreinfo"  style="color:blue; text-decoration:none;">更多信息</a>
    </td>
  </tr>
  <script type="text/javascript">
$(document).ready(function(){
  $("#moreinfo").click(function(){
    $("#moreinfotable").slideToggle();
  });
});

</script>
  <tr id="moreinfotable" style="">
    <td colspan="2" align="left">
    <table border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td>是否为管理员：</td>
    <td>
    <input type="radio" name="admin" value="1" {if $employee.is_admin} checked {/if} />是
      <input type="radio" name="admin" value="0" {if $employee.is_admin eq 0} checked {/if} />否
    </td>
  </tr>
  <tr>
    <td>毕业院校：</td>
    <td><input type="text" name="college" value="{$employee.e_college}" /></td>
  </tr>
  <tr>
    <td>身份证号：</td>
    <td><input type="text" name="cardid" value="{$employee.e_card_id}" /></td>
  </tr>  
  <tr>
    <td>家庭住址：</td>
    <td><input type="text" name="homeaddress" value="{$employee.e_home_address}" /></td>
  </tr>
  <tr>
    <td>目前住址：</td>
    <td><input type="text" name="address" value="{$employee.e_address}" /></td>
  </tr>
  <tr>
    <td>电话：</td>
    <td><input type="text" name="phone" value="{$employee.e_phone}" /></td>
  </tr>
  <tr>
    <td>紧急情况联系人：</td>
    <td><input type="text" name="econtact" value="{$employee.e_emerg_contact}" /></td>
  </tr>
  <tr>
    <td>紧急情况联系电话：</td>
    <td><input type="text" name="ephone" value="{$employee.e_emerg_phone}" /></td>
  </tr>
</table>

    </td>
  </tr>
  
  <tr>
    <td colspan="2" align="center" height="35" valign="bottom">
    <input type="hidden" name="act" value="modu" />
    <input type="hidden" name="eid" value="{$eid}" />
    <input type="submit" value="修改" />
    </td>
  </tr>
</table>

</form>
</div>
<!--{/if} -->
</body>
</html>